#include<bits/stdc++.h>
using namespace std;
int main()
{
	int m;
	char a[10],b[10];
	cin>>m;
	
	for (int i=1; i<=m; i++)
	{
		cin>>a>>b;
		
		//P1胜
		if ((a[0]=='R'&&b[0]=='S')||(a[0]=='P'&&b[0]=='R')||(a[0]=='S'&&b[0]=='P'))
			cout<<"Player1"<<endl;
		//P2胜
		if ((b[0]=='R'&&a[0]=='S')||(b[0]=='P'&&a[0]=='R')||(b[0]=='S'&&a[0]=='P'))
			cout<<"Player2"<<endl;
		//平局
		if (a[0]==b[0]) cout<<"Tie"<<endl;
	}
	
	return 0;
}